package club.jdiy.core.base;

import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.OrderSpecifier;
import lombok.Getter;

/**
 * queryDSL动态查询条件和默认排序字段.
 *
 * 由实现了{@link club.jdiy.core.base.domain.DslFilterable} 的实体类中
 * {@link club.jdiy.core.base.domain.DslFilterable#createFilter(BooleanBuilder)} 方法构造查询条件返回。
 *
 * @author ziquee(子秋) QQ号:39886616 主页: http://www.jdiy.club
 * @version 20210708
 */
@Getter
public class DslFilter {
    /**
     * 动态查询条件
     */
    private final BooleanBuilder builder;
    /**
     * 默认排序字段。
     */
    private final OrderSpecifier<?>[] defaultOrderSpecifiers;

    public DslFilter(BooleanBuilder builder, OrderSpecifier<?>... defaultOrderSpecifiers) {
        this.builder = builder;
        this.defaultOrderSpecifiers = defaultOrderSpecifiers;
    }
}
